/*
 * @brief
 * @author li yong (DogLee)
 * @email 20162439@qq.com
 * @version 1.0
 * @date 2019-06-05 15:46:00
 */
#ifndef LOGAPPENDERNET_H
#define LOGAPPENDERNET_H

#include "ilogappender.h"

class QTcpServer;
class QTcpSocket;
class QTimer;
class LogAppenderNet : public ILogAppender
{
public:
    LogAppenderNet();

    virtual ~LogAppenderNet();

    virtual void append(const DebugMessage &message);

protected slots:
    void onNewConnection();
    void onDump();

protected:
    QTcpServer          *m_tcpServer = Q_NULLPTR;
    QList<DebugMessage> m_messages;
    QTcpSocket          *m_tcpSocket = Q_NULLPTR;
    QTimer              *m_timer = Q_NULLPTR;
};

#endif // LOGAPPENDERNET_H
